<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8" />
    <title>for语句</title>
    <script>
        /*
           for(初始表达式;判断条件;步进语句){
            循环体;
           }
        */

        for (var i = 1; i <= 5; i++) {
            console.log(i);
        }


        for (var i = 5; i >= 1; i--) {
            console.log(i);
        }
    </script>
</head>

<body>
</body>